//------------------------------------------------------------------------------
#ifndef COLORSELECTOR_H
#define COLORSELECTOR_H
//------------------------------------------------------------------------------
#include <QPushButton>
#include <QColorDialog>
//------------------------------------------------------------------------------
class ColorButton : public QPushButton {
		Q_OBJECT
//------------------------------------------------------------------------------
	public:
		explicit ColorButton(QWidget *parent = 0);
		~ColorButton();

		const QColor & selectedColor() const{ return m_selectedColor; }
//------------------------------------------------------------------------------
	private slots:
		void mouseReleased();
//------------------------------------------------------------------------------
	protected:
		void paintEvent(QPaintEvent*);
//------------------------------------------------------------------------------
	public slots:
		void colorSelected(const QColor &col);
//------------------------------------------------------------------------------
	signals:
		void selectedColorChanged(const QColor &color);
//------------------------------------------------------------------------------
	private:
		QColorDialog *m_colorDialog;
		QColor m_selectedColor;
//------------------------------------------------------------------------------
};
//------------------------------------------------------------------------------
#endif // COLORSELECTOR_H
//------------------------------------------------------------------------------
